﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SwenAssigment.Classes
{
    public class Week
    {
        private int WeekNo;
        private int NumberOfRoom;
        public List<Day> Days;
        public Week(int WeekNo, int NumberOfRoom, List<Day> Days)
        {
            this.NumberOfRoom = NumberOfRoom;
            this.WeekNo = WeekNo;
            this.Days = Days;
        }
        public int getWeekNo()
        {
            return WeekNo;
        }
        public List<Day> getDays()
        {
            return Days;
        }
        public Decimal GetStatics()
        {
            Decimal Total = 0;
            foreach (Day day in Days)
            {
                Total += day.getORoom();
            }
            try
            {
                Total = ((Decimal)((Decimal)Total / (NumberOfRoom * Days.Count))) * 100;
            }
            catch (Exception ex)
            {
                Total = 0;
            }

            return Total;
        }
    }
}